<template>
  <div>
    <div class="topsort">
      <span
        class="iconfont icon-arrowRight-copy-copy"
        @click="$router.go(-1)"
      ></span>
      {{this.$route.query.list}}
      <span class="iconfont icon-sousuo"></span>
    </div>

    <div class="bookshelf1">
      <div class="shelfbox" v-for="(item, index) in sortlist" :key="index" @click="$router.push({path:'/bookxq',query:{id:item.id,cover:item.cover}})">
        <img :src="item.cover" class="shelfimg" />
        <div class="stext">
          <p class="shelfname">{{item.text}}</p>
          <p class="shelfsped">{{item.author}}</p>
          <p class="shelfupdata">{{item.d}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import { sourceCat } from "../../api/res";
import { getSeach } from "../../api/seacher";
export default {
  data() {
    return {
      sortlist: "",
    };
  },
  created() {
    console.log(this.$route.query.list);

    getSeach({search:this.$route.query.list}).then((data) => {
        console.log(data.words.w);
        this.sortlist = data.words.w
      });

    // sourceCat().then((data) => {
    //   console.log(data.list);
    //   this.sortlist = data.list;
    // });
  },
};
</script>

<style lang="less">
.topsort {
  width: 100%;
  font-size: 25px;
  font-weight: bold;
  text-align: center;
  line-height: 50px;
  background-color: white;
  border-bottom: 1px solid gainsboro;
  .icon-arrowRight-copy-copy {
    font-size: 25px;
    float: left;
  }
  .icon-sousuo {
    font-size: 25px;
    float: right;
    // margin-left: -10px;
    margin-right: 10px;
  }
}
.bookshelf1 {
  padding-bottom: 65px;
  margin-top: 20px;
  .shelfbox {
    //   border: 1px solid black;
    margin-top: 10px;
    display: flex;
    .shelfimg {
      width: 80px;
      height: 100px;
      // border: 1px solid black;
      margin-left: 20px;
      // background-image: url(../assets/imag/01.jpg);
      // background-size: cover;
    }
    .stext {
      margin-left: 10px;
      margin-top: 7px;
      .shelfname {
        font-size: 18px;
        width: 220px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
      .shelfsped {
        font-size: 10px;
        color: #707070;
      }
      .shelfupdata {
        width: 200px;
        font-size: 10px;
        color: #707070;
        line-height: 25px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
      }
    }
  }
}
</style>